package site_announcement

import "time"

type SiteAnnouncementPo struct {
	Id         int64     `json:"id"`
	Title      string    `json:"title"`
	Content    string    `json:"content"`
	Url        string    `json:"url"`
	Cycle      int32     `json:"cycle"`
	StartTime  time.Time `json:"start_time"`
	EndTime    time.Time `json:"end_time"`
	CreatedOn  time.Time `json:"created_on"`
	CreatedBy  string    `json:"created_by"`
	ModifiedBy string    `json:"modified_by"`
	ModifiedOn time.Time `json:"modified_on"`
	IsDeleted  int32     `json:"is_deleted"`
}

func (p SiteAnnouncementPo) TableName() string {
	return "site_announcement"
}

type SiteAnnouncementViewRecord struct {
	Id                 int64     `gorm:"primaryKey" json:"id"`
	SiteAnnouncementID int64     `gorm:"not null;default:0" json:"site_announcement_id"`
	TenantCode         string    `gorm:"type:varchar(36);not null;default:''" json:"tenant_code"`
	UserID             int64     `gorm:"not null;default:0" json:"user_id"`
	Status             int32     `gorm:"type:tinyint;not null;default:0" json:"status"`
	ViewTime           time.Time `gorm:"type:datetime" json:"view_time"`
	CreatedOn          time.Time `gorm:"type:datetime;not null;default:CURRENT_TIMESTAMP" json:"created_on"`
	CreatedBy          string    `gorm:"type:varchar(36);not null;default:''" json:"created_by"`
	ModifiedOn         time.Time `gorm:"type:datetime;not null;default:CURRENT_TIMESTAMP" json:"modified_on"`
	ModifiedBy         string    `gorm:"type:varchar(36);not null;default:''" json:"modified_by"`
	IsDeleted          int32     `gorm:"type:tinyint;not null;default:0" json:"is_deleted"`
}

func (p SiteAnnouncementViewRecord) TableName() string {
	return "site_announcement_view_record"
}
